//
//@author jltxseo
// Created by junlintianxia on 2018/7/24.
//
#include <jni.h>
#include "TutorialLessonOneNative.h"
#include "TutorialLessonOne.h"


static TutorialLesson *nativeLesson;
/*
 * Class:     com_xq_jltx_learnopenglandroidpro_tutorial_lesson1_TutorialLessonOneNative
 * Method:    nativeOnSurfaceCreate
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_xq_jltx_learnopenglandroidpro_tutorial_lesson1_TutorialLessonOneNative_nativeOnSurfaceCreate
        (JNIEnv *env, jclass jzclass)
{
    nativeLesson = new TutorialLessonOne();
    if(nativeLesson != nullptr){
        nativeLesson->create();
    }
}


/*
 * Class:     com_xq_jltx_learnopenglandroidpro_tutorial_lesson1_TutorialLessonOneNative
 * Method:    nativeOnSurfaceChange
 * Signature: (II)V
 */
JNIEXPORT void JNICALL Java_com_xq_jltx_learnopenglandroidpro_tutorial_lesson1_TutorialLessonOneNative_nativeOnSurfaceChange
        (JNIEnv *env, jclass jzclass , jint width, jint height)
{
    if(nativeLesson != nullptr){
        nativeLesson->change(width,height);
    }

}


/*
 * Class:     com_xq_jltx_learnopenglandroidpro_tutorial_lesson1_TutorialLessonOneNative
 * Method:    nativeOnDrawFrame
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_xq_jltx_learnopenglandroidpro_tutorial_lesson1_TutorialLessonOneNative_nativeOnDrawFrame
        (JNIEnv *env, jclass jzclass)
{
    if(nativeLesson != nullptr){
        nativeLesson->draw();
    }
}


